const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,

  publicPath: './',  //解决打包后图片路径问题 
  // outputDir: 'dist',
  // assetsDir: 'static',

  pages: {
    index: {
      //入口文件
      entry: 'src/main.js',
      //头部title
      title: 'dishdash',
    }
  },

  //关闭eslint告警
  lintOnSave: false,

  //配置代理
  devServer: {
    port: 25080,//端口
    host: '0.0.0.0',//域名
    https: false,//是否开启https
    open: true,//是否自动打开浏览器
    // open: 'Microsoft Edge', // 这里可以指定你想要的浏览器，例如'Google Chrome', 'Mozilla Firefox', 'Safari'
    proxy: {
      '/employeeLogin': {
        target: 'http://localhost:25080',
        changeOrigin: true,
        secure: false,
        ws: true,
        logLevel: 'debug',
        onProxyReq: function(proxyReq, req, res) {
          delete proxyReq.getHeaders().origin;
          delete proxyReq.getHeaders().referer;
          
          console.log('原始请求:', {
            url: req.url,
            method: req.method,
            headers: req.headers
          });
          console.log('代理请求:', {
            path: proxyReq.path,
            method: proxyReq.method,
            headers: proxyReq.getHeaders()
          });
        }
      }
    }
  },

})
